﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace Demo0616
{
    class Student: IComparer
    {
        //学生类(父类)
        public Student() { }//初始化,引用父类


        //定义字段
        private int num;
        private string name;
        private int age;
        //封装字段
        public int Num { get => num; set => num = value; }
        public string Name { get => name; set => name = value; }
        public int Age { get => age; set => age = value; }
        //生成构造函数
        public Student(int num, string name, int age)
        {
            this.num = num;
            this.name = name;
            this.age = age;
        }
        public override string ToString()
        {
            return $" 学号:{Num},姓名:{Name},年龄:{Age}";
        }
        public int Compare(object x, object y)
        {
            throw new NotImplementedException();
        }
    }
}
